package day05_api.com.itheima.d2_lambda;

public class LambdaTest1 {
    public static void main(String[] args) {
        new Animal(){
            @Override
            public void run() {
                System.out.println("跑");
            }
        }.run();

        Animal a2 = new Animal(){
            @Override
            public void run() {
                System.out.println("跑");
            }
        };
        a2.run();

//        Animal a3 = () -> {
//            System.out.println("跑");
//        };
        Swimming s1 = new Swimming() {
            @Override
            public void swim() {
                System.out.println("学生swimming。。。");
            }
        };
        s1.swim();

        Swimming s2 = () -> {
            System.out.println("学生swimming。。。");
        };
        s2.swim();

    }
}

interface Swimming{
    void swim();
}
abstract class Animal{
    public abstract void run();
}
